<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <input type="text" v-model="fname">
    <button @click="add">添加</button>
    <button @click="del">删除</button>
    <div>
        <li :key="index" v-for="(item,index) in list">{{item}}</li>
    </div>
</div>
<script type="text/javascript" src="js/vue.min.js"></script>
<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data: {
            fname: '',
            list: ['apple', 'orange', 'banana']
        },
        methods: {
            add: function () {
                this.list.push(this.fname)
            },
            del: function () {
                this.list.pop();
            }
        }
    })
</script>
</body>
</html>